import { _decorator, Component, Label, Node } from 'cc';
import { PalBattleSkill } from 'db://assets/scripts/PalBattleSystem';
import { SkillDialog } from './SkillDialog';
const { ccclass, property } = _decorator;

@ccclass('SkillItem')
export class SkillItem extends Component {
    @property(Label)
    nameLabel: Label = null!;
    @property(Label)
    costLabel: Label = null!;

    skillDialog: SkillDialog = null!;
    data: PalBattleSkill = null!;
    setData(data: PalBattleSkill, skillDialog: SkillDialog) {
        this.data = data;
        this.skillDialog = skillDialog;
    }

    render(){
        this.nameLabel.string = this.data.originData.name;
        this.costLabel.string = this.data.originData.mpCost.toString();
    }
}


